import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:keyboard_actions/keyboard_actions.dart';
import 'package:keyboard_actions/keyboard_actions_config.dart';
import 'package:oramemo/common/langs/text_key.dart';

import 'theme_utils.dart';

abstract class KeyboardUtil {
   static KeyboardActionsConfig getKeyboardActionsConfig(BuildContext context, List<FocusNode> list) {
    return KeyboardActionsConfig(
      keyboardBarColor: ThemeUtils.getKeyboardActionsColor(context),
      actions: List.generate(list.length, (i) => KeyboardActionsItem(
        focusNode: list[i],
        toolbarButtons: [
          (node) {
            return GestureDetector(
              onTap: () => node.unfocus(),
              child:  Padding(
                padding: const EdgeInsets.only(right: 16.0),
                child: Text(TextKey.close.tr),
              ),
            );
          },
        ],
      )),
    );
  }
}